<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/view/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>房间配置</title>
<link href="${project}/ds/css/styles.css" rel="stylesheet" />
<link href="${project}/ds/lib/layui/css/layui.css" rel="stylesheet" />
<link href="${project}/ds/lib/font-awesome-4.7.0/css/font-awesome.css"
	rel="stylesheet" />
<link href="${project}/ds/css/roomStyle.css" rel="stylesheet" />
<script src="${project}/ds/lib/jquery/jquery-1.3.2.min.js"
	type="text/javascript"></script>
<%@include file="/WEB-INF/view/include/common.jsp"%>
<script src="${project}/ds/lib/layui/layui.js" type="text/javascript"></script>
<script src="${project}/ds/js/js/ws.js" type="text/javascript"></script>
<script src="${project}/ds/js/XHD.js" type="text/javascript"></script>
<script src="${project}/ds/js/layeralert.js" type="text/javascript"></script>
<script src="${project}/ds/js/room/command.js" type="text/javascript"></script>
<script type="text/javascript">
        var layer;
        var form;
        var laydate;
        var DISABLEDCLASS = "layui-btn-disabled";
        var NormalDCLASS = "layui-btn-normal";
        var CONTEXT_PATH = "http://" + document.location.host;
        var user = getCookie("xhdcrm_uid");
        var loadindex;
        var configload;
        var startdate;
        var RoomModel;

        layui.use(['form', 'layer', 'laydate'],
            function () {
                laydate = layui.laydate;
                layer = layui.layer;
                form = layui.form();
                //websocketConnect();
            });
        $(function () {
            //$("#name").val(window.top.currentHousesName);
        	$.ajax({
                url: "/systemConfig/getConfig", type: "POST",
                //data: { T_BanName: $("#N_BanName").val() },
                async: false,
                dataType: "json",
                success: function (result) {
                    /*if (result === "false") {
                        b = false;
                    }*/
                    console.log(result);
                	ShowConfig(result);
                }
            });
        });
       	var State="0";
        function ShowConfig(configdata) {
        	
           // console.log(configdata);
            for (var i in configdata) {
                if (configdata.hasOwnProperty(i)) {
                    var row = configdata[i];
                    var name = row.Name;
                   // console.log(name);
                    var val = row.Value;
                    if (name === "StartTime") {
                        val = Date.parse(val.replace(/-/g, "/"));
                        startdate = val;
                        var date = new Date(val);
                        var year = date.getFullYear();
                        var month = date.getMonth() + 1;
                        var day = date.getDate();
                        var hour = date.getHours();
                        var min = date.getMinutes();
                        var str = year + "-" + month + "-" + day;
                        $("#StartTime").val(str);
                        $("#HouseTime").val(hour);
                        $("#minTime").val(min);

                    }else if(name==="State"){
                    	console.log(val);
                    	State=val;//状态
                        ShowPageState(val);//按钮状态
                    }
                    else if (name === "ReadStartDate") {
                        val = Date.parse(val.replace(/-/g, "/"));
                        var date = new Date(val);
                        var year = date.getFullYear();
                        var month = date.getMonth() + 1;
                        var day = date.getDate();
                        var hour = date.getHours();
                        var min = date.getMinutes();
                        var str = year + "-" + month + "-" + day;
                        $("#ReadStartDate").val(str);
                        $("#ReadStartHour").val(hour);
                        $("#ReadStartMin").val(min);
                    }
                    else if (name === "ReadEndDate") {
                        val = Date.parse(val.replace(/-/g, "/"));
                        var date = new Date(val);
                        var year = date.getFullYear();
                        var month = date.getMonth() + 1;
                        var day = date.getDate();
                        var hour = date.getHours();
                        var min = date.getMinutes();
                        var str = year + "-" + month + "-" + day;
                        $("#ReadEndDate").val(str);
                        $("#ReadEndHour").val(hour);
                        $("#ReadEndMin").val(min);
                    }
                    else if (name === "ReadTestStartDate") {
                        val = Date.parse(val.replace(/-/g, "/"));
                        var date = new Date(val);
                        var year = date.getFullYear();
                        var month = date.getMonth() + 1;
                        var day = date.getDate();
                        var hour = date.getHours();
                        var min = date.getMinutes();
                        var str = year + "-" + month + "-" + day;
                        $("#ReadTestStartDate").val(str);
                        $("#ReadTestStartHour").val(hour);
                        $("#ReadTestStartMin").val(min);
                    }
                    else if (name === "ReadTestEndDate") {
                        val = Date.parse(val.replace(/-/g, "/"));
                        var date = new Date(val);
                        var year = date.getFullYear();
                        var month = date.getMonth() + 1;
                        var day = date.getDate();
                        var hour = date.getHours();
                        var min = date.getMinutes();
                        var str = year + "-" + month + "-" + day;
                        $("#ReadTestEndDate").val(str);
                        $("#ReadTestEndHour").val(hour);
                        $("#ReadTestEndMin").val(min);
                    }
                    else if (name === "IsShowUserCount") {
                        if (val === "1") {
                            $("#IsShowUserCount").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsTest") {
                        if (val === "1") {
                            $("#IsTest").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowDiscount") {
                        if (val === "1") {
                            $("#IsShowDiscount").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowReadTestStartDate") {
                        if (val === "1") {
                            $("#IsShowReadTestStartDate").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowReadTestEndDate") {
                        if (val === "1") {
                            $("#IsShowReadTestEndDate").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowReadStartDate") {
                        if (val === "1") {
                            $("#IsShowReadStartDate").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowReadEndDate") {
                        if (val === "1") {
                            $("#IsShowReadEndDate").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "LoginTest") {
                        if (val === "1") {
                            $("#LoginTest").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsLoginTime") {
                        if (val === "1") {
                            $("#IsLoginTime").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowPrice") {
                        if (val === "1") {
                            $("#IsShowPrice").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowYHGS") {
                        if (val === "1") {
                            $("#IsShowYHGS").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowYZMorSFZ") {
                        if (val === "1") {
                            $("#IsShowYZMorSFZ").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                    else if (name === "IsShowLDGD") {
                        if (val === "1") {
                            $("#IsShowLDGD").attr('checked', 'true');
                            //form.render('checkbox');
                        }
                    }
                  
                    else {
                        $("#" + name).val(val);
                    }
                }else{
                	console.log("haha");
                }
            }
            //计算时间
            CalculateTime();
            $(".layui-input").unbind("blur").blur(function () {
                setTimeout(function () {
                        startdate = GetStartTime();//更新开始时间
                        CalculateTime();
                    },
                    200);
            });

            $("#ReadTestStartDate").unbind("blur").blur(function () {
                setTimeout(function () {
                    $("#ReadTestEndDate").val($("#ReadTestStartDate").val());
                },
                    200);
            });
            $("#ReadTestEndDate").unbind("blur").blur(function () {
                setTimeout(function () {
                    $("#ReadTestStartDate").val($("#ReadTestEndDate").val());
                },
                    200);
            });
            $("#ReadStartDate").unbind("blur").blur(function () {
                setTimeout(function () {
                    $("#ReadEndDate").val($("#ReadStartDate").val());
                },
                    200);
            });
            $("#ReadEndDate").unbind("blur").blur(function () {
                setTimeout(function () {
                    $("#ReadStartDate").val($("#ReadEndDate").val());
                },
                    200);
            });
           // layer.close(layerindex);
        }

        function CalculateTime() {
            //计算预览时间
            ShowPreDateTime();
            //计算倒计时时间
            ShowCountDownDateTime();
            //计算总时间
            ShowAllTime();
        }

        //计算预览时间
        function ShowPreDateTime() {
            var mins = parseInt($("#PreviewTime").val());
            var ndate = new Date(startdate);
            $("#auxpre").html("（分钟） " + addMinute(ndate, mins) + " 结束预览");
        }
        //计算倒计时时间
        function ShowCountDownDateTime() {
            var mins = - parseInt($("#CountDownTime").val());
            var ndate = new Date(startdate);
            $("#auxdown").html("（分钟） " + addMinute(ndate, mins) + " 开始倒计");
        }
        //计算总时间
        function ShowAllTime() {
            var mins = parseInt($("#ShoppingTime").val());
            var ndate = new Date(startdate);
            $("#auxall").html("（分钟） " + addMinute(ndate, mins) + " 结束抢购");
        }

        function setdisable(obj) {
            obj.attr("disabled", "disabled");
            obj.removeClass(NormalDCLASS).addClass(DISABLEDCLASS);
        }

        function removedisable(obj) {
            obj.attr("disabled", false);
            obj.removeClass(DISABLEDCLASS).addClass(NormalDCLASS);
        }

        //抢购状态更新
        function ShowPageState(state) {
        	 console.log(state);
            if (state === "0" || state === "6") {//0未开始，或者 6全部结束
            	console.log(state);
                $("#roomstart").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", SetStart);
                $("#stopall").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
                $("#ClearHouseBtn").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", ClearHouse);
                $("#ClearRoomBtn").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", ClearRoom);
                $("#save").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", save);
                

            } else {
                $("#stopall").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", SetStop);
                $("#roomstart").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
                $("#ClearHouseBtn").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
                $("#ClearRoomBtn").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
                $("#save").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
            }
            if (state === "0" || state === "1" || state === "2" || state === "3" ||state==="4" || state === "5" || state === "6") {
                $("#clearandsave").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", ClearAndSave);
                removedisable($(".layui-input"));
            }
            else{
                $("#clearandsave").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");

                setdisable($(".layui-input"));
            }
            if (state === "4") {
            	console.log("开");
                $("#roomend").removeClass(DISABLEDCLASS).addClass(NormalDCLASS).bind("click", SetEnd);
            } else {
            	console.log("关");
                $("#roomend").removeClass(NormalDCLASS).addClass(DISABLEDCLASS).unbind("click");
            }
            //form.render('checkbox');
        }

        function addMinute(date, mins) {
            mins = date.getMinutes() + mins;
            var r = new Date(date.setMinutes(mins));
            var str = r.format("yyyy年MM月dd日 hh时mm分");
            return str;
        }

        function closeconfigload() {
            layer.close(loadindex);
        }

        //抢购开启
        function SetStart() {
            /* loadindex = layload("请等待数据库更新");
            var json = window.wsorder.setstart(user);
            websocket.send(jsON.stringify(json)); */
        	changeState("4");
        }
        
        //抢购项目结束 用户还可以预览
        function SetEnd() {
            /* loadindex = layload("请等待数据库更新");
            var json = window.wsorder.setend(user);
            websocket.send(jsON.stringify(json)); */
            changeState("5");
        }
        
        //抢购全部结束 用户退出
        function SetStop() {
            /* loadindex = layload("请等待数据库更新");
            var json = window.wsorder.setstop(user);
            websocket.send(jsON.stringify(json)); */
        	changeState("0");
        }
		function changeState(state){
			$.post("/systemConfig/changeState", { "state": state },
					   function(result){
						ShowConfig(result);
						 layer.msg("操作成功");
					   }, "json");
		}
        function getconfig() {
            $("#IsShowUserCount").val($("#IsShowUserCount").attr('checked') ? "1" : "0");
            //$("#IsShowDiscount").val($("#IsShowDiscount").attr('checked') ? "1" : "0");
            $("#IsTest").val($("#IsTest").attr('checked') ? "1" : "0");
            $("#IsShowReadTestStartDate").val($("#IsShowReadTestStartDate").attr('checked') ? "1" : "0");
            $("#IsShowReadTestEndDate").val($("#IsShowReadTestEndDate").attr('checked') ? "1" : "0");
            $("#IsShowReadStartDate").val($("#IsShowReadStartDate").attr('checked') ? "1" : "0");
            $("#IsShowReadEndDate").val($("#IsShowReadEndDate").attr('checked') ? "1" : "0");
            $("#LoginTest").val($("#LoginTest").attr('checked') ? "1" : "0");
            $("#IsLoginTime").val($("#IsLoginTime").attr('checked') ? "1" : "0");
            $("#IsShowPrice").val($("#IsShowPrice").attr('checked') ? "1" : "0");
            $("#IsShowYHGS").val($("#IsShowYHGS").attr('checked') ? "1" : "0");
            $("#IsShowYZMorSFZ").val($("#IsShowYZMorSFZ").attr('checked') ? "1" : "0");
            $("#IsShowLDGD").val($("#IsShowLDGD").attr('checked') ? "1" : "0");
            
            var json = $("#form1").serializeArray();
            //console.log("json="+json);
            var config = [];
            for (var i in json) {
                if (json.hasOwnProperty(i)) {
                    var row = json[i];
                    if (row.name === "StartTime") {
                        row.value = GetStartTime();
                    }
                    else if (row.name === "ReadStartDate") {
                        row.value = GetReadStartDate();
                    }
                    else if (row.name === "ReadEndDate") {
                        row.value = GetReadEndDate();
                    }
                    else if (row.name === "ReadTestStartDate") {
                        row.value = GetReadTestStartDate();
                    }
                    else if (row.name === "ReadTestEndDate") {
                        row.value = GetReadTestEndDate();
                    }
                    config.push({ Name: row.name, Value: row.value });
                }
            }
            if (!$("#IsShowUserCount").attr('checked')) {
                config.push({ Name: "IsShowUserCount", Value: $("#IsShowUserCount").val() });
            }
            if (!$("#IsTest").attr('checked')) {
                config.push({ Name: "IsTest", Value: $("#IsTest").val() });
            }
            /* if (!$("#IsShowDiscount").attr('checked')) {
                config.push({ Name: "IsShowDiscount", Value: $("#IsShowDiscount").val() });
            } */
            if (!$("#IsShowReadTestStartDate").attr('checked')) {
                config.push({ Name: "IsShowReadTestStartDate", Value: $("#IsShowReadTestStartDate").val() });
            }
            if (!$("#IsShowReadTestEndDate").attr('checked')) {
                config.push({ Name: "IsShowReadTestEndDate", Value: $("#IsShowReadTestEndDate").val() });
            }
            if (!$("#IsShowReadStartDate").attr('checked')) {
                config.push({ Name: "IsShowReadStartDate", Value: $("#IsShowReadStartDate").val() });
            }
            if (!$("#IsShowReadEndDate").attr('checked')) {
                config.push({ Name: "IsShowReadEndDate", Value: $("#IsShowReadEndDate").val() });
            }
            if (!$("#LoginTest").attr('checked')) {
                config.push({ Name: "LoginTest", Value: $("#LoginTest").val() });
            }
            if (!$("#IsLoginTime").attr('checked')) {
                config.push({ Name: "IsLoginTime", Value: $("#IsLoginTime").val() });
            }
            if (!$("#IsShowPrice").attr('checked')) {
                config.push({ Name: "IsShowPrice", Value: $("#IsShowPrice").val() });
            }
            if (!$("#IsShowYHGS").attr('checked')) {
                config.push({ Name: "IsShowYHGS", Value: $("#IsShowYHGS").val() });
            }
            if (!$("#IsShowYZMorSFZ").attr('checked')) {
                config.push({ Name: "IsShowYZMorSFZ", Value: $("#IsShowYZMorSFZ").val() });
            }
            if (!$("#IsShowLDGD").attr('checked')) {
                config.push({ Name: "IsShowLDGD", Value: $("#IsShowLDGD").val() });
            }
           
            config.push({ Name: "State", Value: State });
            //console.log(config);
            return JSON.stringify(config);
        }
        
        function save() {
            var str = getconfig();
           /*  var s = {
                action: "redis",
                msg: {
                    Action: "configupdate", Remark: str, Operation: user
                }
            } */
            //     var s = { action: "configupdate", Remark: str, Operation: user };
            console.log(str);
           // submitConfig(str);
            
            $.ajax({
            	type: "POST",
            	url:"/systemConfig/save",
            	data: "json="+str,
            	dataType: "json",
            	success:function(result){
         					ShowConfig(result);
         					layer.msg("保存成功");
					   },				
			});
        }

        function ClearAndSave() {
            var str = getconfig();
          /*   var s = {
                action: "redis",
                msg: {
                    Action: "clearandupdateconfig", Remark: str, Operation: user
                }
            } */
           // submitConfig(str);
            $.post("/systemConfig/clearAndSave", { "json": str},
					   function(result){
         					ShowConfig(result);
         					layer.msg("保存成功");
					   }, "json");
        }

        function GetStartTime() {
            var StartTime = $("#StartTime").val();
            var house = $("#HouseTime").val();
            house = house.length === 1 ? "0" + house : house;
            var min = $("#minTime").val();
            min = min.length === 1 ? "0" + min : min;
            var value = StartTime + " " + house + ":" + min + ":00";
            return value;
        }


        function GetReadStartDate() {
            var Date = $("#ReadStartDate").val();
            var hour = $("#ReadStartHour").val();
            hour = hour.length === 1 ? "0" + hour : hour;
            var min = $("#ReadStartMin").val();
            min = min.length === 1 ? "0" + min : min;
            var value = Date + " " + hour + ":" + min + ":00";
            return value;
        }
        function GetReadEndDate() {
            var Date = $("#ReadEndDate").val();
            var hour = $("#ReadEndHour").val();
            hour = hour.length === 1 ? "0" + hour : hour;
            var min = $("#ReadEndMin").val();
            min = min.length === 1 ? "0" + min : min;
            var value = Date + " " + hour + ":" + min + ":00";
            return value;
        }
        function GetReadTestStartDate() {
            var Date = $("#ReadTestStartDate").val();
            var hour = $("#ReadTestStartHour").val();
            hour = hour.length === 1 ? "0" + hour : hour;
            var min = $("#ReadTestStartMin").val();
            min = min.length === 1 ? "0" + min : min;
            var value = Date + " " + hour + ":" + min + ":00";
            return value;
        }
        function GetReadTestEndDate() {
            var Date = $("#ReadTestEndDate").val();
            var hour = $("#ReadTestEndHour").val();
            hour = hour.length === 1 ? "0" + hour : hour;
            var min = $("#ReadTestEndMin").val();
            min = min.length === 1 ? "0" + min : min;
            var value = Date + " " + hour + ":" + min +":00";
            return value;
        }

        //点击提交配置
        function submitConfig(json) {
            //loadindex = layload("请等待数据库更新");
           // console.log(json);
           // window.websocket.send(jsON.stringify(json));
            $.post("/systemConfig/save", { "json": json},
					   function(result){
            		ShowConfig(result);
					   }, "json");
        }

        //清除房间记录
        function ClearRoom() {
            layer.confirm(
                '该功能会所有房间操作记录，是否确认清除？',
                { icon: 3, title: '提示' },
                function (index) {
                    loadindex = layload("请等待数据库更新");
                   /*  var json = window.wsorder.dataclear(user);
                    websocket.send(jsON.stringify(json)); */
                    $.post("/systemConfig/ClearRoom", { "do": 1},
     					   function(result){
                 				ShowConfig(result);
                 				layer.msg("操作成功");
                 				layer.close(loadindex);
     					   }, "json");
                    
                    layer.close(index);
                });
        }

        //项目初始化
        function ClearHouse() {
            layer.confirm(
                '该功能操作无法挽回，请谨慎操作！',
                { icon: 3, title: '提示' },
                function (index) {
                    layer.close(index);
                    loadindex = layload("数据处理中");
                    $.ajax({
                        url: "/systemConfig/clearHouse",
                        type: "post",
                        async: true,
                        dataType: "json",
                        success: function(data) {
              				layer.close(loadindex);
              				layer.msg("操作成功");
                        	ShowConfig(data);
                        }
                    });
                });
        }
        
        function wsallclearreply() {
            closeconfigload();
            DeleteModel(RoomModel);
        }



        function GetRoomModel() {
            var HouseModel;
            $.ajax({
                type: "GET",
                url: "../data/Tuser.ashx", /* 注意后面的名字对应CS的方法名称 */
                data: { Action: 'GetHouseModel' }, /* 注意参数的格式和名称 */
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async: false,
                success: function (result) {
                    HouseModel = result;
                }
            });
            return HouseModel;
        }

        function DeleteModel(Model) {
            for (var i = 0; i < Model.length; i++) {
                $.ajax({
                    url: "http://122.228.248.78:19000/DeleteImage?Name=" + Model[i],
                    type: "Get",
                    async: false,
                    success: function (d) {

                    }
                });
            }
        }
        
    </script>
<style type="text/css">
.datetime {
	font: bold 14px/20px 宋体;
	color: black;
	letter-spacing: 2px;
}
</style>
</head>
<body>
	<form id="form1">
		<div class="layui-form"
			style="float: right; margin-top: 80px; margin-right: 40px">
			<div class="layui-form-item">
				<div class="layui-input-inline" style="width: 40px">
					<input type="checkbox" id="IsShowReadTestStartDate"
						name="IsShowReadTestStartDate" lay-skin="switch" lay-text="显示|隐藏"
						class="layui-input" />
				</div>
				<label class="layui-form-label" style="width: 90px">公测开始时间</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="ReadTestStartDate" name="ReadTestStartDate"
						class="layui-input"
						onclick="layui.laydate({ elem: this, min: new Date().format('yyyy-MM-dd'), istoday: false, isclear: false, issure: false, istime: false, format: 'YYYY-MM-DD' })" />
				</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadTestStartHour" placeholder="时"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux">:</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadTestStartMin" placeholder="分"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline" style="width: 40px">
					<input type="checkbox" id="IsShowReadTestEndDate"
						name="IsShowReadTestEndDate" lay-skin="switch" lay-text="显示|隐藏"
						class="layui-input" />
				</div>
				<label class="layui-form-label " style="width: 90px">公测结束时间</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="ReadTestEndDate" name="ReadTestEndDate"
						class="layui-input"
						onclick="layui.laydate({ elem: this, min: new Date().format('yyyy-MM-dd'), istoday: false, isclear: false, issure: false, istime: false, format: 'YYYY-MM-DD' })" />
				</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadTestEndHour" placeholder="时"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux">:</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadTestEndMin" placeholder="分"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline" style="width: 40px">
					<input type="checkbox" id="IsShowReadStartDate"
						name="IsShowReadStartDate" lay-skin="switch" lay-text="显示|隐藏"
						class="layui-input" />
				</div>
				<label class="layui-form-label " style="width: 90px">正式开始时间</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="ReadStartDate" name="ReadStartDate"
						class="layui-input"
						onclick="layui.laydate({ elem: this, min: new Date().format('yyyy-MM-dd'), istoday: false, isclear: false, issure: false, istime: false, format: 'YYYY-MM-DD' })" />
				</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadStartHour" placeholder="时"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux">:</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadStartMin" placeholder="分"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline" style="width: 40px">
					<input type="checkbox" id="IsShowReadEndDate"
						name="IsShowReadEndDate" lay-skin="switch" lay-text="显示|隐藏"
						class="layui-input" />
				</div>
				<label class="layui-form-label " style="width: 90px">正式结束时间</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="ReadEndDate" name="ReadEndDate"
						class="layui-input"
						onclick="layui.laydate({ elem: this, min: new Date().format('yyyy-MM-dd'), istoday: false, isclear: false, issure: false, istime: false, format: 'YYYY-MM-DD' })" />
				</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadEndHour" placeholder="时"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux">:</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="ReadEndMin" placeholder="分"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
			</div>
		</div>
		<div class="layui-form" style="margin-top: 20px; float: left">
			<div class="layui-form-item">
				<div class="layui-input-block">
					<div id="roomstart" class="layui-btn layui-btn-disabled">开始</div>
					<div id="roomend"
						class="layui-btn layui-btn-normal layui-btn-disabled">结束</div>
					<div id="ClearRoomBtn"
						class="layui-btn layui-btn-danger layui-btn-disabled">所有房间设置未售</div>
					<div id="ClearHouseBtn"
						class="layui-btn layui-btn-danger layui-btn-disabled">项目初始化</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label ">项目名称</label>
					<div class="layui-input-inline" style="width: 145px;">
						<input type="text" id="HouseName" name="HouseName"
							class="layui-input" />
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label " style="width: 100px">咨询电话</label>
					<div class="layui-input-inline" style="width: 145px;">
						<input type="text" id="HouseTel" name="HouseTel"
							class="layui-input" />
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label " style="width: 100px">参与人数</label>
					<div class="layui-input-inline" style="width: 145px;">
						<input type="text" id="JoinCount" name="JoinCount"
							class="layui-input" />
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label ">过期周期</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" name="ExpiredCycle" id="ExpiredCycle"
							class="layui-input" />
					</div>
					<div class="layui-form-mid layui-word-aux">（秒）</div>
				</div>
				<div class="layui-inline" style="display: none">
					<%--功能已弃用--%>
					<label class="layui-form-label" style="width: 100px">选房次数</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" name="ShoppingCartUpper" id="ShoppingCartUpper"
							class="layui-input" />
					</div>
					<%--<div class="layui-form-mid layui-word-aux">（乘以认筹数）</div>--%>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px;">换行数</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" name="RoomLine" id="RoomLine"
							class="layui-input" />
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label ">翻红时间</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" id="RandomRedTime" name="RandomRedTime"
							class="layui-input" />
					</div>
					<div class="layui-form-mid layui-word-aux">（秒）</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label " style="width: 100px">收藏数量上限</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" id="CollectionCount" name="CollectionCount"
							class="layui-input" />
					</div>
				</div>

				<div class="layui-inline">
					<label class="layui-form-label " style="width: 100px">登录锁定次数</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" id="LockCount" name="LockCount"
							class="layui-input" />
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label ">开始时间</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="StartTime" name="StartTime"
						class="layui-input"
						onclick="layui.laydate({ elem: this, min: new Date().format('yyyy-MM-dd'), istoday: false, isclear: false, issure: false, istime: false, format: 'YYYY-MM-DD' })" />
				</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="HouseTime" placeholder="时"
						onkeyup="value = value.replace(/[^\d]/g, '')" maxlength="2"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux">:</div>
				<div class="layui-input-inline" style="width: 50px;">
					<input type="text" id="minTime" placeholder="分"
						onkeyup="value = value.replace(/[^\d]/g, '')" class="layui-input"
						maxlength="2" />
				</div>
			</div>
			<div class="layui-form-item" style="display: none">
				<label class="layui-form-label ">预览时长</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="PreviewTime" name="PreviewTime"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux datetime" id="auxpre">（分钟）</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label ">倒计时长</label>
				<div class="layui-input-inline" style="width: 100px;">
					<input type="text" id="CountDownTime" name="CountDownTime"
						class="layui-input" />
				</div>
				<div class="layui-form-mid layui-word-aux datetime" id="auxdown">（分钟）</div>
			</div>


			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label ">抢购时长</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" id="ShoppingTime" name="ShoppingTime"
							class="layui-input" />
					</div>
					<div class="layui-form-mid layui-word-aux datetime" id="auxall">（分钟）</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 52px">测试</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsTest" name="IsTest" lay-skin="switch"
							lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">显示报名人数</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsShowUserCount" name="IsShowUserCount"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">登陆免判断模式</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="LoginTest" name="LoginTest"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline" style="display: none">
					<%--功能已弃用--%>
					<label class="layui-form-label" style="width: 100px">登录时间限定</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsLoginTime" name="IsLoginTime"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">显示价格</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsShowPrice" name="IsShowPrice"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">显示优惠公示</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsShowYHGS" name="IsShowYHGS"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<%--<div class="layui-inline">
                    <label class="layui-form-label" style="width:100px">显示优惠价格</label>
                    <div class="layui-input-inline" style="width:60px">
                        <input type="checkbox" id="IsShowDiscount" name="IsShowDiscount" lay-skin="switch" lay-text="ON|OFF" class="layui-input"/>
                    </div>
                </div>--%>
				<br>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">验证码</label>
					<!-- 开 验证码 关 身份证 -->
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsShowYZMorSFZ" name="IsShowYZMorSFZ"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label" style="width: 100px">楼栋更多</label>
					<div class="layui-input-inline" style="width: 60px">
						<input type="checkbox" id="IsShowLDGD" name="IsShowLDGD"
							lay-skin="switch" lay-text="ON|OFF" class="layui-input" />
					</div>
				</div>
				
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<div id="clearandsave"
						class="layui-btn layui-btn-danger layui-btn-disabled">设置未售并保存</div>
					<div id="save"
						class="layui-btn layui-btn-normal layui-btn-disabled">保存</div>
					<div id="stopall"
						class="layui-btn layui-btn-danger layui-btn-disabled">全部结束</div>
				</div>
			</div>
		</div>
	</form>
</body>
</html>